﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using LogIn_App.DAO;
using LogIn_App.Model;

namespace LogIn_App.Services
{
    public class LogInService
    {
        private readonly LogInDao _logInDao;

        public LogInService(LogInDao logInDao)
        {
            _logInDao = logInDao;
        }
        public bool LogIn(string loginName,string passwd)
        {
            if (string.IsNullOrWhiteSpace(loginName) && string.IsNullOrWhiteSpace(passwd))
            {
                return false;
            }

            var password =  _logInDao.GetPassWd(loginName);

            return passwd.Equals(password);
        }
    }
}
